﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Simple.Repository.Models
{
    /// <summary>
    /// 食材
    /// </summary>
    public class FoodMaterials : BusinessFullEntityBase<Guid>
    {
        /// <summary>
        /// 食物名称
        /// </summary>
        public string FoodName { get; set; }
        /// <summary>
        /// 来源(0-系统，1-外部)
        /// </summary>
        public int Source { get; set; }
        /// <summary>
        /// 食部
        /// </summary>
        public decimal FoodDepartment { get; set; }
        /// <summary>
        /// 热量
        /// </summary>
        public decimal Heat { get; set; }
        /// <summary>
        /// 蛋白质
        /// </summary>
        public decimal Protein { get; set; }
        /// <summary>
        /// 脂肪
        /// </summary>
        public decimal Fat { get; set; }
        /// <summary>
        /// 碳水化合物
        /// </summary>
        public decimal Carbohydrate { get; set; }
        /// <summary>
        /// 视黄醇
        /// </summary>
        public decimal Retinol { get; set; }
        /// <summary>
        /// 胡萝卜素
        /// </summary>
        public decimal Carotene { get; set; }
        /// <summary>
        /// 钙
        /// </summary>
        public decimal Calcium { get; set; }
        /// <summary>
        /// 铁
        /// </summary>
        public decimal Iron { get; set; }
        /// <summary>
        /// 锌
        /// </summary>
        public decimal Zinc { get; set; }
        /// <summary>
        /// 磷
        /// </summary>
        public decimal Phosphorus { get; set; }
        /// <summary>
        /// 尼克酸
        /// </summary>
        public decimal NicotinicAcid { get; set; }
        /// <summary>
        /// VitA
        /// </summary>
        public decimal VitA { get; set; }
        /// <summary>
        /// VitB1
        /// </summary>
        public decimal VitB1 { get; set; }
        /// <summary>
        /// VitB2
        /// </summary>
        public decimal VitB2 { get; set; }
        /// <summary>
        /// VitC
        /// </summary>
        public decimal VitC { get; set; }

        /// <summary>
        /// 食材分类
        /// </summary>
        public Guid FoodMaterialsTypeId { get; set; }

        public FoodMaterialsType? FoodMaterialsType { get; set; }

        public List<RecipesDetails>? RecipesDetailsList { get; set; }

        public override void ConfigureEntity(ModelBuilder builder)
        {
            builder.Entity<FoodMaterials>(entity =>
            {
                entity.HasOne(c => c.FoodMaterialsType).WithMany(c => c.FoodList).HasForeignKey(c => c.FoodMaterialsTypeId);
            });
        }

    }
}
